//BZOJ 2618
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <cassert>

using namespace std;

const double eps=1e-7;
inline int dcmp(const double &d){if(fabs(d)<eps) return 0;else return d>0?1:-1;}
struct Point{
    double x,y;
    Point(double x=0,double y=0):x(x),y(y){}
    const Point operator + (const Point &p) const{return Point(x+p.x,y+p.y);}
    const Point operator - (const Point &p) const{return Point(x-p.x,y-p.y);}
    const Point operator / (const double &d) const{return Point(x/d,y/d);}
    const bool operator != (const Point &p) const{return dcmp(x-p.x)||dcmp(y-p.y);}
    friend const Point operator * (const double &d,const Point &p){return Point(d*p.x,d*p.y);}
};
double cross(const Point &p,const Point &q){
    return p.x*q.y-p.y*q.x;
}
struct Line{
    Point u,v;
    double k;
    Line(const Point &u=Point(),const Point &v=Point()):u(u),v(v){}
    void getK(){k=atan2(v.y-u.y,v.x-u.x);}
    const bool operator < (const Line &l) const{
        int t=dcmp(k-l.k);
        if(t==0) return dcmp(cross(l.v-u,v-u))>0;
        else return t<0;
    }
};
double area(const Point &p,const Point &q,const Point &r){
    return cross(q-p,r-p);
}
Point inter(const Line &m,const Line &n){
    double k1,k2;
    k1=area(m.u,n.u,n.v);
    k2=area(n.u,m.v,n.v);
    return (k1*m.v+k2*m.u)/(k1+k2);
}

const int maxn=1505;
Point pts[maxn],conv[maxn];
Line lne[maxn];
int q[maxn];
int n;
const bool inHalfPlane(const Point &p,const Line &l){
    return dcmp(cross(l.v-l.u,p-l.u))>=0;
}
int uniq(){
    int tot=0;
    tot++;
    for(int i=1;i<n;i++) if(dcmp(lne[i].k-lne[i-1].k)) lne[tot++]=lne[i];
    return tot;
}
int halfPlaneIntersection(){
    int f,r,tot,ans;
    sort(lne,lne+n);
    tot=uniq();
    //printf("lne:\n");for(int i=0;i<tot;i++) printf("(%.3f,%.3f) - (%.3f,%.3f) k=%.3f\n",lne[i].u.x,lne[i].u.y,lne[i].v.x,lne[i].v.y,lne[i].k);
    f=r=0;
    q[r++]=0;q[r++]=1;
    for(int i=2;i<tot;i++){
        while(f<r-1&&!inHalfPlane(inter(lne[q[r-1]],lne[q[r-2]]),lne[i])) r--;
        while(f<r-1&&!inHalfPlane(inter(lne[q[f]],lne[q[f+1]]),lne[i])) f++;
        q[r++]=i;
    }
    while(f<r-1&&!inHalfPlane(inter(lne[q[r-1]],lne[q[r-2]]),lne[q[f]])) r--;
    while(f<r-1&&!inHalfPlane(inter(lne[q[f]],lne[q[f+1]]),lne[q[r-1]])) f++;
    ans=0;
    q[r]=q[f];
    for(int i=f;i<r;i++) conv[ans++]=inter(lne[q[i]],lne[q[i+1]]);
    tot=ans;
    ans=1;
    for(int i=1;i<tot;i++) if(conv[i]!=conv[i-1]) conv[ans++]=conv[i];
    while(ans>1&&!(conv[ans-1]!=conv[0])) ans--;
    return ans;
}
double area(const int &n){
    //printf("area:n=%d\n",n);
    if(n<3) return 0;
    double ans=0;
    conv[n]=conv[0];
    for(int i=0;i<n;i++)
        ans+=area(Point(),conv[i],conv[i+1]);
    //printf("area:ans=%.3f\n",ans);
    return ans/2;
}

int main(){
    int N;
    int t;
    double d;
    scanf("%d",&N);
    n=0;
    while(N--){
        int m;
        scanf("%d",&m);
        for(int i=0;i<m;i++) scanf("%lf%lf",&pts[i].x,&pts[i].y);
        pts[m]=pts[0];
        for(int i=0;i<m;i++) lne[n].u=pts[i],lne[n].v=pts[i+1],lne[n++].getK();
    }
    printf("%.3f\n",d=area(t=halfPlaneIntersection()));
    //for(int i=0;i<t;i++) printf("(%.3f,%.3f)\n",conv[i].x,conv[i].y);
}
